home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
misc
/
vpan100.zip
/
VPLED.H
< prev
next >
Wrap
C/C++ Source or Header
|
1995-01-12
|
2KB
|
84 lines
//
// VIRTUAL PANELS * GRAPHIC USER UNTERFACE FOR LABORATORY WORKS
//
// VPLED.H : CLASS: LED
//
// | Written by O.Rasizade
// declarations | Dec 1992
// |
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#ifndef __cplusplus
#error Must use C++
#endif
#ifndef __VPLED_H
#define __VPLED_H
//++++++++++++++++++++++++++++++++++++++++++++++
//++++++ COLORS ++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++
struct LEDcolors {
COLORS title,on,off;
};
//-------- Default LED colors
#define TITLECOL BLACK
const LEDcolors redLED=
{
TITLECOL,
LIGHTRED, // LED is on
RED // LED is off
};
const LEDcolors greenLED=
{
TITLECOL,
LIGHTGREEN, // LED is on
GREEN // LED is off
};
const LEDcolors yellowLED=
{
TITLECOL,
YELLOW, // LED is on
BROWN // LED is off
};
class LED
{
protected:
LEDcolors indcol;
char *title;
int indradius,indxx,indyy;
int txfont,txsize;
public:
int on; // if 1 then LED lighted on
//----- Constructor ------- All coord. and sizes in VGA pixels ----
LED(
int _indx,int _indy,
char *_title,
// Hereafter are defaults
int _radius=4, // radius of indicator
int txfont=0,int txsize=1, // font style and size of title
LEDcolors _indcol=redLED //colors of LED
);
LED(int _indradius, LEDcolors _indcol=redLED)
{ on=0; indcol=_indcol; indradius=xx__x(_indradius); }
virtual void Paint(void);
void On(void); // switch on or off indicator
void Off(void);
void Invert(void) // Change state of indicator to opposite
{ (on)?Off():On();}
};//++++++++++++++ END of class LED +++++++++++++++++++
#endif // __VPLED_H